package com.ruoyi.goods.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.GoodsLogistics;
import com.ruoyi.system.service.GoodsLogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods/logistics")
public class GoodsLogisticsController {

    @Autowired
    private GoodsLogisticsService goodsLogisticsService;

    /**
     * 根据订单 Id 查询物流
     */
    @GetMapping("/{orderId}")
    public AjaxResult getLogistics(@PathVariable String orderId) {
        GoodsLogistics goodsLogistics = goodsLogisticsService.queryByOrderId(orderId);
        return AjaxResult.success(goodsLogistics);
    }
}
